home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <dos/dosextens.h>
- #include <time.h>
- #include <stdlib.h>
- #include <fcntl.h>
- #include <stdio.h>
- #include "bbs.protos"
-
- void Randomize(void)
- {
- long timet;
- long t;
-
- timet=time((APTR)&t);
- srand(timet);
- }
-
- int rnd(int x)
- {
- int i;
- if(x<=0) return(0);
- Randomize();
- do {
- i=rand()%x;
- }
- while(i>x);
- return(i);
- }
-
- void rand_color(void)
- {
- char colorbuff[6]={0x1B, 0x5B, 0x33, 0x31, 0x6D, 0x00}; /* Removed space 0A */
-
- colorbuff[3] = (rand() % 6) + 0x31;
- AEPutStr(colorbuff);
- }
-